
const http =  require("http")
const port = 2114
const hostname = "localhost"


//请求   request
//response  响应

const server = http.createServer((request,response)=>{
    console.log(request.url)
    response.writeHead(200,{'content-Type':'text/html;charset=utf8'})
    response.write("<h2>node服务器</h2>")
    response.end()
})

server.listen(port,hostname,()=>{
    console.log("server is successful");
})